package ms;


import java.io.PrintWriter;

import java.net.Socket;
import java.util.Scanner;

public class Send {
    public static void main(String[] args) throws Exception {
        Integer x=new Integer(10);
        //创建连接  连接远程的 localhost 和5000 端口
        Socket socket = new Socket("localhost", 5000);
        //两个管道建立连接
        PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
        Scanner sc = new Scanner(System.in);  //输入流
        while (true) {
            String mess = sc.next();
            //通过out.println()讲消息写给远程
            out.println(mess);
        }
    }
}
